ihelpuoo.weboo.runtime.ModuleEventHandler = function()
{
}

ihelpuoo.weboo.runtime.ModuleEventHandler.prototype
=
{
	onClickTitle: function()
	{
		var ele = ihelpuoo.event.srcElement(this);
		var rt = ihelpuoo.weboo.runtime.me();
		var m = rt.getModule(ele.innerHTML);
		rt.setActiveModule(m);
		m.HTML.openSub();
		m.disActiveAction();
		if(m.contentChanged)
			m.reload();
		m.render();
		var arena = document.getElementById("arena");
		ihelpuoo.dom.hideChildren(arena);
		var detailHTML = m.detail.render();
		if(!ihelpuoo.dom.contains(arena,detailHTML))
		{
			arena.appendChild(detailHTML);
		}
	}

	,onClickIcon: function()
	{
		var ele = ihelpuoo.event.srcElement(this);
		var m = ihelpuoo.weboo.runtime.me().getModule(ele.getAttribute("name"));
		if(m.HTML.isOpened())
			m.HTML.closeSub();
		else
		{
			m.HTML.openSub();
			if(m.contentChanged)
			{
				m.reload();
				m.render();
			}
		}
	}
}